<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "wx_member_card_map".
 *
 * @property int $id 自增id
 * @property string $openid 领取会员卡的openid
 * @property string $cardcode
 * @property string $cardid
 * @property int $modifybouns 变动的积分值
 * @property int $modifybalance 变动的余额值
 * @property int $status 1-已领取, 2-已激活
 * @property int $getcard_at 领卡时间
 * @property int $activate_at 激活时间
 */
class MemberCardMap extends \yii\db\ActiveRecord
{
	const STATUS_GETCARD = 1;
	
	const STATUS_ACTIVATE = 2;
	
    /**
     * @inhersitdoc
     */
    public static function tableName()
    {
        return 'wx_member_card_map';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['openid', 'cardid', 'getcard_at', 'activate_at'], 'required'],
            [['modifybouns', 'modifybalance', 'status', 'getcard_at', 'activate_at'], 'integer'],
            [['openid', 'cardcode', 'cardid'], 'string', 'max' => 100],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'openid' => 'Openid',
            'cardcode' => 'Cardcode',
            'cardid' => 'Cardid',
            'modifybouns' => 'Modifybouns',
            'modifybalance' => 'Modifybalance',
            'status' => 'Status',
            'getcard_at' => 'Get Card At',
            'activate_at' => 'Activate At',
        ];
    }
}
